/**
 * Created by Lwang on 2017-03-30.
 * 主入口文件
 */

//less模块
require("./lib/layer_mobile/need/layer.css");
require("../less/car-location.less");
require("../less/earn-detail.less");
require("../less/list-detail.less");
require("../less/my-earn.less");
require("../less/my-finance.less");
require("../less/product-detail.less");
require("../less/product-list.less");
require("../less/project-introduct.less");
require("../less/public.less");
require("../less/register.less");
require("../less/servicer.less");
require("../less/tips.less");
require("angular");
import uiRouter from "angular-ui-router";
import allModule from "./controller/controlEntry.js";
import serviceModule from "./services/service.js";
import routecfg from "./config/route_config";
allModule();
serviceModule();
var app = angular.module("app", [uiRouter, "allModule", "serviceModule"]);

app.run(["$rootScope", "$state", "Http", "$timeout", function ($rootScope, $state, Http, $timeout) {
    $rootScope.prefix = "http://api.jshrdtz.com";
    $rootScope.$on("$stateChangeSuccess", function (event, toState, toParams, fromState, current) {
        $timeout(function () {
            $rootScope.ofTitle = toState.title;
        }, 1);
    })
}]);
app.config(routecfg);
angular.bootstrap(document, ['app']);